package com.ruoyi.appService.images.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
//        import com.rchuing.common.utils.DateUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.appService.images.mapper.ZImagesMapper;
import com.ruoyi.appService.images.domain.ZImages;
import com.ruoyi.appService.images.service.IZImagesService;

/**
 * 轮播图信息Service业务层处理
 *
 * @author yuqihe
 * @date 2025-04-23
 */
@Service
public class ZImagesServiceImpl extends ServiceImpl<ZImagesMapper, ZImages> implements IZImagesService {
    @Autowired
    private ZImagesMapper zImagesMapper;

    /**
     * 查询轮播图信息
     *
     * @param id 轮播图信息主键
     * @return 轮播图信息
     */
    @Override
    public ZImages selectZImagesById(Long id) {
        return zImagesMapper.selectZImagesById(id);
    }

    /**
     * 查询轮播图信息列表
     *
     * @param zImages 轮播图信息
     * @return 轮播图信息
     */
    @Override
    public List<ZImages> selectZImagesList(ZImages zImages) {
        return zImagesMapper.selectZImagesList(zImages);
    }

    /**
     * 新增轮播图信息
     *
     * @param zImages 轮播图信息
     * @return 结果
     */
    @Override
    public int insertZImages(ZImages zImages) {
        zImages.setCreateTime(DateUtils.getNowDate());
        return zImagesMapper.insertZImages(zImages);
    }

    /**
     * 修改轮播图信息
     *
     * @param zImages 轮播图信息
     * @return 结果
     */
    @Override
    public int updateZImages(ZImages zImages) {
        zImages.setUpdateTime(DateUtils.getNowDate());
        return zImagesMapper.updateZImages(zImages);
    }

    /**
     * 批量删除轮播图信息
     *
     * @param ids 需要删除的轮播图信息主键
     * @return 结果
     */
    @Override
    public int deleteZImagesByIds(Long[] ids) {
        return zImagesMapper.deleteZImagesByIds(ids);
    }

    /**
     * 删除轮播图信息信息
     *
     * @param id 轮播图信息主键
     * @return 结果
     */
    @Override
    public int deleteZImagesById(Long id) {
        return zImagesMapper.deleteZImagesById(id);
    }
}